<template>
  <el-container>
    <el-header height="120px">
    </el-header>
    <el-main>
      <router-view></router-view>
    </el-main>
    <el-footer>
    </el-footer>
  </el-container>
</template>


<script>
// require Vue
define(['vue', "VueRouter", "loader!app/Test", "httpVueLoader"], function (Vue, VueRouter, test, httpVueLoader) {

  const routes = [{
    path: "/", component: test,
    props: {datas: ["a", "b"], id: "1"}
  }, {
    path: "/index.html", redirect: "/"
  }, {
    path: "/index", redirect: "/"
  }];
  const router = new VueRouter({
    routes: routes // （缩写）相当于 routes: routes
  });

  // create and return app instance
  // refer template as `template`
  return new Vue({
    template: template,
    router,
    data: {},
    method: {
      onMenuSelected: function (key, keyPath) {
        console.log(router)
        console.log(this)
        console.log("x")
      }
    }
  })
});
</script>